﻿<div class="d-flex mb-3">
    <label class="mr-1">排序：</label>
    <Radio OnStateChanged="@OnStateChanged" Items="@Items"></Radio>
</div>
<Timeline Items="TimelineItems" IsReverse="@IsReverse"></Timeline>

@code {
    /// <summary>
    /// 
    /// </summary>
    /// <param name="state"></param>
    /// <param name="value"></param>

    public Task OnStateChanged(CheckboxState state, SelectedItem value)
    {
        IsReverse = value.Text == "倒序";
        StateHasChanged();
        return Task.CompletedTask;
    }

    /// <summary>
    /// 
    /// </summary>
    private IEnumerable<SelectedItem> Items { get; set; } = new SelectedItem[]
    {
        new SelectedItem("1","正序"){ Active=true },
        new SelectedItem("2","倒序")
    };

    private bool IsReverse { get; set; }
}
